package item.inkcloud.communityservice.pojo;

import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ArticleUtils {

    public static String getCurrentDate(){

        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

        String currentDate = dateFormat.format(new Date());

        return currentDate;
    }

    public static String getArticleId(String author){

        Date date = new Date();
        SimpleDateFormat minuteDateFormat = new SimpleDateFormat("HH:mm");
        SimpleDateFormat dayDateFormat = new SimpleDateFormat("yyyy-MM-dd");

        String day = dayDateFormat.format(date);
        String minute = minuteDateFormat.format(date);

        String articleId = day + "-" + author + "-" + minute;

        return  articleId;



    }


}
